package source.control;

import source.Enums.Side;
import source.calcCmd.RobotCommand;

public class Command {

	private int time;
	private double vR;
	private double vL;
	
	public Command(){
		time = 0;
		vL = vR = 0;
	}
	
	public Command (int time, double vL, double vR){
		
		this.time = time;
		this.vL = vL;
		this.vR = vR;
	}

	public int getTime() {
		return time;
	}

	public Command(RobotCommand rCmd){
		this.time = rCmd.getRealTime();
		this.vL = rCmd.getRealV(Side.LEFT);
		this.vR = rCmd.getRealV(Side.RIGHT);
	}
	
	public void setTime(int time) {
		this.time = time;
	}

	public Command(Command cmd){
		this.vL = cmd.getV(Side.LEFT);
		this.vR = cmd.getV(Side.RIGHT);
		this.time = cmd.getTime();
	}
	
	public void setV(double v, Side side){
		switch (side){
		case LEFT: vL = v; break;
		case RIGHT: vR = v; break;
		}
	}
	
	public double getV(Side side){
		switch (side){
		case LEFT: return vL;
		case RIGHT: return vR;
		default: return 0;
		}
	}

	
}
